/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.scene.mapper;

import com.koron.common.bean.StaffBean;
import com.koron.personal.domain.MyCertificate;
import com.koron.scene.domain.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface DangerousOperationMapper {

    Integer insert(@Param("bean") DangerousOperation bean);

    Integer update(@Param("bean") DangerousOperation bean);

    DangerousOperation queryOne(@Param("id") String id);

    DangerousOperationVo getDangerousOperation(@Param("id") String id);

    Integer delete(@Param("id") String id);

    List<DangerousOperation> queryByCondition(@Param("corpCode") String corpCode,
                                              @Param("operationCategory") String operationCategory, @Param("operationTicketType") String operationTicketType,
                                              @Param("operationCategoryName") String operationCategoryName, @Param("operationTicketTypeName") String operationTicketTypeName,
                                              @Param("operationCode") String operationCode, @Param("status") Integer status,
                                              @Param("startTime")String startTime,  @Param("endTime")String endTime, @Param("start") Integer start, @Param("rows") Integer rows,
                                              @Param("keyword") String keyword);

    Integer countByCondition(@Param("corpCode") String corpCode, @Param("operationCategory") String operationCategory, @Param("operationTicketType") String operationTicketType,
                             @Param("operationCategoryName") String operationCategoryName, @Param("operationTicketTypeName") String operationTicketTypeName,
                             @Param("operationCode") String operationCode, @Param("status") Integer status,
                             @Param("startTime")String startTime,  @Param("endTime")String endTime,@Param("keyword") String keyword);

    List<SafetyMeasure> getAllSafetyMeasureByCondition(@Param("operationCategory") Integer operationCategory, @Param("operationTicketType") Integer operationTicketType);

    List<RiskIdentificationAndMeasures> getAllRiskIdentificationAndMeasuresByCondition(@Param("operationCategory") Integer operationCategory, @Param("operationTicketType") Integer operationTicketType);

    List<OperationType> getAllOperationTypeByCondition(@Param("operationCategory") Integer operationCategory, @Param("operationTicketType") Integer operationTicketType);

    List<PersonalProtectionAndEmergency> getAllProtectionAndEmergencyByCondition(@Param("operationCategory") Integer operationCategory, @Param("operationTicketType") Integer operationTicketType);

    DangerousOperationAnalysis getAnalysis(@Param("codeList")  List<String> codeList, @Param("startTime") String startTime, @Param("endTime") String endTime);

    DangerousOperationAnalysisBean getAnalysisByStatus(@Param("codeList") List<String> codeList, @Param("status") Integer status, @Param("startTime") String startTime, @Param("endTime") String endTime);

    String queryMaxCode(@Param("code") String code);

    List<DangerousOperation> getDangerousOperationList(@Param("codes") String codes, @Param("start") Integer start, @Param("pageSize") Integer pageSize);

    Integer getDangerousOperationCount(@Param("codes")String codes);

    List<MyCertificate> getCertificate(@Param("corpCode") String corpCode, @Param("certificateTypeName") String certificateTypeName);

    List<StaffBean> getStaff(@Param("userCodeList")List<String> userCodeList);

    List<DangerousOperation> homePageOperationList(@Param("deptCodes") String deptCodes,
                                                   @Param("operationCategory") String operationCategory, @Param("operationTicketType") String operationTicketType,
                                                   @Param("operationCategoryName") String operationCategoryName, @Param("operationTicketTypeName") String operationTicketTypeName,
                                                   @Param("operationCode") String operationCode, @Param("status") Integer status,
                                                   @Param("startTime")String startTime,  @Param("endTime")String endTime, @Param("start") Integer start, @Param("rows") Integer rows);

    Integer homePageOperationCount(@Param("deptCodes") String deptCodes, @Param("operationCategory") String operationCategory, @Param("operationTicketType") String operationTicketType,
                                   @Param("operationCategoryName") String operationCategoryName, @Param("operationTicketTypeName") String operationTicketTypeName,
                                   @Param("operationCode") String operationCode, @Param("status") Integer status,
                                   @Param("startTime")String startTime,  @Param("endTime")String endTime);

    Integer updateFlowSign(@Param("bean") DangerousOperation bean);

    DangerousOperation detail(@Param("id") String id);
}
